---
category: Level 1 — Basic
created: '2020-02-16'
keywords:
title: Check if an element has given class
---

```js
ele.classList.contains('class-name');
```

## See also

-   [Add or remove class from an element](https://phuoc.ng/collection/html-dom/add-or-remove-class-from-an-element/)
